package com.ssm.pojo;

import com.alibaba.excel.annotation.ExcelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Pattern;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Manager {
    @ExcelProperty("#")
    private int num;
    @ExcelProperty("账号")
    @Pattern(regexp = "(^[0-9]{4,14}$)", message = "账号应为4~14数字")
    private String amount;
    @ExcelProperty("密码")
    @Pattern(regexp = "(^[a-zA-Z0-9]{6,12}$)", message = "密码应为6~12字母或数字")
    private String password;
    @ExcelProperty("姓名")
    @Pattern(regexp = "(^[\\u4e00-\\u9fa5]{1,7})", message = "姓名应为1~7个汉字")
    private String name;
    @ExcelProperty("性别")
    private int sex;
    @ExcelProperty("年龄")
    private int age;
    @ExcelProperty("身份证")
    private String id;
    @ExcelProperty("电话")
    private String phone;
    @ExcelProperty("住址")
    private String address;
    @ExcelProperty("宿舍楼")
    private String cdorm;
    @ExcelProperty("宿舍")
    private String sdorm;

    public Manager(String amount, String password, String name, int sex, int age, String id, String phone, String address, String cdorm, String sdorm) {
        this.amount = amount;
        this.password = password;
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.id = id;
        this.phone = phone;
        this.address = address;
        this.cdorm = cdorm;
        this.sdorm = sdorm;
    }
}
